package com.xzl.xep.dao;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;



public interface BaseDao {

	public <T> T  saveObject(T object);

	public <T> T  saveOrUpdateObject(T object);


	public <T> T  updateObject(T object) ; 

	public  <T> void delObject(T object) ;
	
	
	public  <T> T loadObject(Class<T> clazz, Serializable id);


	
	public  <T> List<T> selectByHql(String hql) ;
	
	public Integer selectIntByHql(String hql);
	
	public Double selectDoubleByHql(String hql);
	
	public <T> List<T> selectByHql(String hql,Integer first,Integer max) ;
	

	public <T> List<T> selectBySql(String sql) ;
	
	public <T> T selectOneBySql(String sql,Class<?> claz) ;
	
	
	public <T> List<T> selectBySql(String sql,Class<?> claz);
	

	public <T> List<T> selectBySql(String sql,int first,int max,Class<?> claz);


	public <T> List<T> selectBySql(String sql,int first,int max) ;
	
	public int executeByHql(String hql) ;

	public int executeBySql(String sql) ;
	
	
	public <T> T selectOneByHql(String hql) ;

	public <T> void saveCollection(Collection<T> collection) ;

	public Integer selectIntBySql(String string);
	
}
